package main

import "fmt"

func main() {

	// i的循环
	for i := 0; i < 3; i++ {
		fmt.Println(i)
	}

	// string 遍历
	str := "hello world"
	fmt.Println(str)
	for index,char := range str {
		fmt.Println(index, ":", char)
	}

	// map 遍历
	mp := make(map[string]int)
	mp["route"] = 66
	mp["brazil"] = 4
	mp["china"] = 960
	for k, v := range mp {
		fmt.Println(k, v)
	}

	// array 遍历
	array := [...]string{"皇家马德里", "巴塞罗那", "拜仁慕尼黑", "切尔西"}
	for index, value := range array {
		fmt.Println("index=", index, "value=", value)
	}
}